.container {
  padding: 24px;
  // height: 100%;
  overflow-y: auto;
  // background-color: #FAFAFA;

  :global(.dark) & {
    color: inherit; // 添加一个属性，避免空规则集警告
    // background-color: #121212;
  }

  .tabs {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;

    :global(.dark) & {
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .tab {
      padding: 8px 0;
      font-size: 14px;
      cursor: pointer;
      position: relative;
      color: rgba(0, 0, 0, 0.6);
      font-weight:500;

      :global(.dark) & {
        color: rgba(255, 255, 255, 0.6);
      }

      transition: color 0.4s ease;

      &::after {

        opacity: 0;
        background-color: rgba(255, 255, 255, 0.1);
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 0%;
        height: 2px;
      }

      &.active {
        color: #000;
        // font-weight: 500;

        :global(.dark) & {
          color: #fff;
        }

        &::after {
          content: '';
          position: absolute;
          bottom: -1px;
          left: 0;
          width: 100%;
          height: 2px;
          background-color: #000;
          opacity: 1;
          // transition: background-color 0.2s ease;
          transition: opacity 0.4s ease, background-color 0.2s ease,width 0.4s ease-in-out;


          :global(.dark) & {
            background-color: #fff;
          }
        }
      }
    }
  }



  .searchContainer {
    position: relative;
    margin-bottom: 24px;

    .searchInput {
      width: 100%;
      padding: 8px 12px 8px 36px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 6px;
      font-size: 14px;
      outline: none;
      background-color: #fff;
      color: rgba(0, 0, 0, 0.8);

      :global(.dark) & {
        background-color: #2E3033;
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
      }

      &:focus {
        border-color: rgba(0, 0, 0, 0.3);

        :global(.dark) & {
          border-color: rgba(255, 255, 255, 0.3);
        }
      }
    }

    .searchIcon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: rgba(0, 0, 0, 0.5);
      width: 16px;
      height: 16px;

      :global(.dark) & {
        color: rgba(255, 255, 255, 0.5);
      }
    }
  }

  .categories {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;

    .category {
      padding: 6px 16px;
      border-radius: 8px;
      font-size: 14px;
      white-space: nowrap;
      cursor: pointer;
      background-color: #fff;
      color: #353535;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #D6DBE5;
      transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);

      :global(.dark) & {
        background-color: #1F2023;
        color: #8F8F8F;
        border: 1px solid #3F4245;
      }

      &.active {
        border: 1px solid #EEF0F4;
        background-color: #EEF0F4 !important;

        :global(.dark) & {
          background-color: #3F4043 !important;
          color: #fff;
          border: 1px solid #3F4043;
        }
      }
    }

    .category:hover {
      border: 1px solid #E3E3E3;
      background-color: #F3F3F3;

      :global(.dark) & {
        background-color: #1F2023;
        border: 1px solid #3F4245;
        color: #fff;
      }
    }
  }

  .line {
    margin: 24px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    :global(.dark) & {
      border-top: 1px solid #3F4245;
    }
  }

  .pluginsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;

    .pluginCard {
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 8px;
      padding: 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      position: relative;
      transition: all 0.2s;
      background-color: #fff;

      :global(.dark) & {
        background-color: #2E3033;
        border-color: rgba(255, 255, 255, 0.1);
      }

      &:hover {
        border-color: rgba(0, 0, 0, 0.2);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

        :global(.dark) & {
          border-color: rgba(255, 255, 255, 0.2);
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
      }

      .pluginIcon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f5f5f5;
        color: #000;

        :global(.dark) & {
          background-color: #2A2A2A;
          color: #fff;
        }
      }

      .pluginInfo {
        flex: 1;

        .pluginName {
          font-weight: 500;
          margin-bottom: 4px;
          color: rgba(0, 0, 0, 0.9);

          :global(.dark) & {
            color: rgba(255, 255, 255, 0.9);
          }
        }

        .pluginNamespace {
          font-size: 12px;
          color: rgba(0, 0, 0, 0.5);

          :global(.dark) & {
            color: rgba(255, 255, 255, 0.5);
          }
        }
      }

      .installButton {
        // position: absolute;
        top: 16px;
        right: 16px;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
        background: linear-gradient(138deg, #6846F4 0%, #004DFF 39%, #00C4DE 76%, #52CE73 100%);
        color: white;
        border: none;
        cursor: pointer;

        &.disabled {
          background-color: transparent;
          border: 1px solid rgba(0, 0, 0, 0.2);
          color: rgba(0, 0, 0, 0.5);

          :global(.dark) & {
            border-color: rgba(255, 255, 255, 0.2);
            color: rgba(255, 255, 255, 0.5);
          }
        }
      }
    }
  }

  .loadingIndicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: rgba(0, 0, 0, 0.6);
    font-size: 14px;

    :global(.dark) & {
      color: rgba(255, 255, 255, 0.6);
    }
  }
}


.status {
  align-self: flex-start;

  :global(.dark) & {
    color: rgba(255, 255, 255, 0.7);
  }

  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.addCustomButtonContainer {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.addCustomButton {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;

  &:hover {
    background-color: #333;
  }
}

.deleteButton {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 16px;
  margin-left: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;

  &:hover {
    background-color: #eee;
  }

  :global(.dark) & {
    background-color: #0d6efd;
    color: white;

    &:hover {
      background-color: #0b5ed7;
    }
  }
}

// Dialog styles
.dialogOverlay {
  background: rgba(0, 0, 0, 0.08);
  position: fixed;
  inset: 0;
  animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.dialogContent {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 552px;
  max-height: 85vh;
  padding: 20px;
  animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;

  :global(.dark) & {
    background: #1F2023;
    color: #e5e7eb;
  }
}

// 插件详情弹窗样式
.pluginDetailsContent {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 600px;
  max-height: 85vh;
  padding: 0;
  animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  :global(.dark) & {
    background-color: #1f1f1f;
    color: #e5e7eb;
  }
}

.pluginDetailsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;

  :global(.dark) & {
    border-color: #333;
  }
}

.pluginDetailsTitle {
  font-size: 18px;
  font-weight: 600;
  margin: 0;

  :global(.dark) & {
    color: #ffffff;
  }
}

.pluginDetailsTabs {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;

  :global(.dark) & {
    border-color: #333;
  }
}

.pluginDetailsTab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  position: relative;

  &.active {
    color: #000;

    &::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      width: 100%;
      height: 2px;
      background-color: #000;
    }

    :global(.dark) & {
      color: #fff;

      &::after {
        background-color: #fff;
      }
    }
  }

  :global(.dark) & {
    color: #9ca3af;
  }
}

.viewSourceButton {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 13px;
  color: #3b82f6;
  cursor: pointer;

  &:hover {
    text-decoration: underline;
  }

  :global(.dark) & {
    color: #60a5fa;
  }
}

.pluginDetailsBody {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}

.aboutContent {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;

  :global(.dark) & {
    color: #d1d5db;
  }
}

.pluginDescription {
  margin-top: 0;
  margin-bottom: 20px;
}

.featuresTitle {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;

  :global(.dark) & {
    color: #f9fafb;
  }
}

.featuresList {
  margin: 0;
  padding-left: 20px;

  li {
    margin-bottom: 8px;
  }
}

.pluginDetailsFooter {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;

  :global(.dark) & {
    border-color: #333;
  }
}

.deletePluginButton {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  background-color: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  cursor: pointer;

  &:hover {
    background-color: rgba(239, 68, 68, 0.05);
  }

  :global(.dark) & {
    color: #f87171;
    border-color: #f87171;

    &:hover {
      background-color: rgba(248, 113, 113, 0.1);
    }
  }
}

.editPluginButton {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  background-color: #000;
  color: white;
  border: none;
  cursor: pointer;

  &:hover {
    background-color: #1a1a1a;
  }

  :global(.dark) & {
    background-color: #3b82f6;

    &:hover {
      background-color: #2563eb;
    }
  }
}

.dialogHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dialogTitle {
  font-size: 18px;
  font-weight: 600;
  margin: 0;

  :global(.dark) & {
    color: #ffffff;
  }
}

.closeButton {
  width: 25px;
  height: 25px;
  background: transparent;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: #151515;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;

  &:hover {
    background: #F3F3F3;
  }

  :global(.dark) & {
    color: #fff;

    &:hover {
      background: #313234;
      color: #fff;
    }
  }
}

.content {
  max-height: 491px;
  overflow-y: auto;
}

.formGroup {
  margin-bottom: 16px;

  &.switchGroup {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .formLabel {
      margin-bottom: 0;
    }

    .switchRoot {
      width: 36px;
      height: 20px;
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 10px;
      position: relative;
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
      display: flex;
      align-items: center;

      :global(.dark) & {
        background: rgb(88, 89, 90);
      }

      &[data-state='checked'] {
        // background: linear-gradient(138deg, #6846F4 0%, #004DFF 39%, #00C4DE 76%, #52CE73 100%);
        background: #1ED760;

        :global(.dark) & {
          background: rgb(249, 248, 246);
        }
      }


    }

    .switchThumb {
      display: block;
      width: 16px;
      height: 16px;
      background-color: white;
      border-radius: 50%;
      box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
      transition: transform 300ms;
      transform: translateX(0px);
      will-change: transform;
      margin: 0 2px;

      :global(.dark) & {
        background-color: rgb(47, 47, 48);
      }

      &[data-state='checked'] {
        transform: translateX(16px);

        :global(.dark) & {
          background-color: #000;
        }
      }
    }
  }
}

.formLabel {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;

  :global(.dark) & {
    color: #d1d5db;
  }
}

.formInput {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background-color: #fff;

  &:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  }

  &::placeholder {
    color: #9ca3af;
  }

  :global(.dark) & {
    background-color: #2E3033;
    border-color: #3F4245;
    color: #e5e7eb;

    &::placeholder {
      color: #6b7280;
    }

    &:focus {
      border-color: #60a5fa;
      box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
    }
  }
}

.jsonTextarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background-color: #fff;

  resize: vertical;

  &:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  }

  &::placeholder {
    color: #9ca3af;
  }

  :global(.dark) & {
    background-color: #2E3033;
    border-color: #4b5563;
    color: #e5e7eb;

    &::placeholder {
      color: #6b7280;
    }

    &:focus {
      border-color: #60a5fa;
      box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
    }
  }
}

.variableRow {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.addVariableButton,
.addArgumentButton {
  width: 132px;
  height: 32px;
  // padding: 6px 15px;
  background: linear-gradient(180deg, #FFFFFF 0%, #EEF0F4 100%);
  border-radius: 8px;
  border: 1px solid #D6DBE5;
  font-size: 14px;
  color: #353535;
  text-align: center;
  margin-right: 10px;

  :global(.dark) & {
    border: 1px solid #3F4245;
    background: #1F2023;
    color: #fff;
  }

  &:hover {
    background: #F3F3F3;
    border: 1px solid #E3E3E3;

    :global(.dark) & {
      background: #313234;
      border: 1px solid #3F4245;
      box-shadow: none;
    }
  }
}

.jsonModeLink {
  text-align: right;
  color: #3b82f6;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 20px;
  font-weight: 500;

  &:hover {
    text-decoration: underline;
  }

  :global(.dark) & {
    color: #60a5fa;
  }
}

.dialogFooter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.cancelButton {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: #E8E8E8;
  color: #6b7280;

  cursor: pointer;
  flex: 1;

  :global(.dark) & {
    border: 1px solid #3F4245;
    background: #1F2023;
    color: #fff;
  }

  &:hover {
    background: #EEF0F4;

    :global(.dark) & {
      background: #313234;
      border: 1px solid #3F4245;
    }
  }

}

.addButton {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: #151515;
  color: white;
  border: none;
  cursor: pointer;

  :global(.dark) & {
    border: 1px solid #3F4245;
    background: #1F2023;
    color: #fff;
  }

  &:hover {
    background: #353535;

    :global(.dark) & {
      background: #313234;
      border: 1px solid #3F4245;
    }
  }
}



// json modal  嵌套在 Add Custom Plugin Modal 中
.modalWrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0px 4px 6px 0px rgba(195, 195, 195, 0.5);
  background: rgba(0, 0, 0, 0.08);
  border-radius: 9px;
  // animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(4px);

  :global(.dark) & {
    color: #fff;
    box-shadow: none;

  }

  .content {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
    width: 100%;
    /* max-width: 400px; */
    padding: 25px;
    position: absolute;
    animation: Plugins_contentShow__2qSnz 150ms cubic-bezier(0.16, 1, 0.3, 1);
    bottom: 0;

    :global(.dark) & {
      color: #fff;
      box-shadow: none;
      background-color: #1F2023;
    }

  }

  .title {
    margin: 0;
    font-weight: 500;
    color: #000;
    font-size: 17px;
    margin-bottom: 20px;

    :global(.dark) & {
      color: #d1d5db;
    }
  }

  .closeButton {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #151515;
    border-radius: 50%;

    &:hover {
      background: #F3F3F3;
    }

    :global(.dark) & {
      color: #fff;

      &:hover {
        background: #313234;
        color: #fff;
      }
    }
  }


  .formGroup {
    margin-bottom: 20px;
  }

  .label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;

    :global(.dark) & {
      color: #d1d5db;
    }
  }

  .textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;

    &:focus {
      outline: none;
      border-color: #d1d5db;
    }

    :global(.dark) & {
      background-color: #2E3033;
      border-color: #4b5563;
      color: #d1d5db;
    }

  }

  .buttonGroup {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
  }

  .primaryButton {
    background: linear-gradient(180deg, #000000 0%, #444444 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    flex: 1;

    :global(.dark) & {
      border: 1px solid #3F4245;
      background: #1F2023;
      color: #fff;
    }

    &:hover {
      background: linear-gradient(180deg, #000000 0%, #444444 100%);
      box-shadow: inset 0px 0px 3px 0px rgba(255, 255, 255, 0.48);

      :global(.dark) & {
        background: #313234;
        border: 1px solid #3F4245;
        box-shadow: none;
      }
    }
  }

  .secondaryButton {
    flex: 1;
    background: #fff;
    color: #6b7280;
    border: 1px solid #E3E3E3;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;

    :global(.dark) & {
      border: 1px solid #3F4245;
      background: #1F2023;
      color: #fff;
    }

    &:hover {
      background: #F3F3F3;
      border: 1px solid #E3E3E3;

      :global(.dark) & {
        background: #313234;
        border: 1px solid #3F4245;
        box-shadow: none;
      }
    }
  }
}



@keyframes overlayShow {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes contentShow {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}